package com.zyz.L_泛型.自定义泛型;

import java.util.List;

/**
 * @author: vick
 * @Date: 2025/4/2
 * @Description:
 * @version: 1.0
 */
public class DAOTest {
    public static void main(String[] args) {
        DAO<User> userDAO = new DAO<>();
        userDAO.save("1001", new User(1, 22, "aa"));
        userDAO.save("1002", new User(2, 32, "bb"));
        userDAO.save("1003", new User(3, 42, "cc"));


        userDAO.update("1002", new User(4, 52, "dd"));

        userDAO.delete("1002");

        List<User> list = userDAO.list();
        for (User u : list) {
            System.out.println(u);
        }
    }
}
